From 5dd0e3d6314c65ecc2c22a5bafb5980d931dc26f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 25 Apr 2001 16:17:46 +0000 Subject: [PATCH] Test for window == NULL in a number of cases. Wed Apr 25 12:16:36 2001 Owen Taylor * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for window == NULL in a number of cases. * tests/testdnd.c: Set module path for gdk-pixbuf. --- ChangeLog | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-0 | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-10 | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-2 | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-4 | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-6 | 31 +++++++++++++++++++++++++++++++ ChangeLog.pre-2-8 | 31 +++++++++++++++++++++++++++++++ gdk/x11/gdkevents-x11.c | 14 ++++++++------ tests/testdnd.c | 13 +++++++++++++ 9 files changed, 238 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c323b48a74..624238df19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c323b48a74..624238df19 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,34 @@ +Wed Apr 25 12:16:36 2001 Owen Taylor + + * gdk/X11/gdkevents-x11.c (gdk_event_translate): Test for + window == NULL in a number of cases. + + * tests/testdnd.c: Set module path for gdk-pixbuf. + +Thu Apr 19 16:11:07 2001 Owen Taylor + + * gtk/Makefile.am xembed.h: File containing #defines + for XEMBED protocol. + + * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: + + - Change protocol from old plug/socket specific protocol + to XEMBED draft + - Various fixes to work with GTK+-2.0 + + Still quite a bit of work to do here to handle initiation + from the socket side (as specified by XEMBED), to handle + the more advanced features of XEMBED, and to figure out + a good way to handle same-app embedding with less overhead + than using full XEMBED. + +Wed Apr 18 16:04:28 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_real_set_focus): Keep + track of whether the toplevel has the focus; only send + focus-in events to the focus widget when the window + actually has the focus. + 2001-04-25 Havoc Pennington * gtk/gtkwindow.h: set_decorations_hint and set_functions_hint diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 22eb7a3179..8767c33a70 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -756,7 +756,8 @@ gdk_event_translate (GdkEvent *event, xevent->xcrossing.subwindow)); /* Handle focusing (in the case where no window manager is running */ - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && + if (window && + GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && xevent->xcrossing.detail != NotifyInferior && xevent->xcrossing.focus && !window_impl->has_focus) { @@ -842,7 +843,8 @@ gdk_event_translate (GdkEvent *event, xevent->xcrossing.detail, xevent->xcrossing.subwindow)); /* Handle focusing (in the case where no window manager is running */ - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && + if (window && + GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && xevent->xcrossing.detail != NotifyInferior && xevent->xcrossing.focus && !window_impl->has_focus) { @@ -922,7 +924,7 @@ gdk_event_translate (GdkEvent *event, GDK_NOTE (EVENTS, g_message ("focus in:\t\twindow: %ld", xevent->xfocus.window)); - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) + if (window && GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) { gboolean had_focus = HAS_FOCUS (window_impl); @@ -951,7 +953,7 @@ gdk_event_translate (GdkEvent *event, GDK_NOTE (EVENTS, g_message ("focus out:\t\twindow: %ld", xevent->xfocus.window)); - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) + if (window && GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) { gboolean had_focus = HAS_FOCUS (window_impl); @@ -1155,7 +1157,7 @@ gdk_event_translate (GdkEvent *event, * an unmap, it means we hid the window ourselves, so we * will have already flipped the iconified bit off. */ - if (GDK_WINDOW_IS_MAPPED (window)) + if (window && GDK_WINDOW_IS_MAPPED (window)) gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_ICONIFIED); @@ -1174,7 +1176,7 @@ gdk_event_translate (GdkEvent *event, event->any.window = window; /* Unset iconified if it was set */ - if (((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_ICONIFIED) + if (window && (((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_ICONIFIED)) gdk_synthesize_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0); diff --git a/tests/testdnd.c b/tests/testdnd.c index a35115fec1..c46eeb1ece 100644 --- a/tests/testdnd.c +++ b/tests/testdnd.c @@ -551,6 +551,17 @@ source_drag_data_delete (GtkWidget *widget, g_print ("Delete the data!\n"); } +void +test_init () +{ + if (g_file_test ("../gdk-pixbuf/.libs/libpixbufloader-pnm.so", + G_FILE_TEST_EXISTS)) + { + putenv ("GDK_PIXBUF_MODULEDIR=../gdk-pixbuf/.libs"); + putenv ("GTK_IM_MODULE_FILE=./gtk.immodules"); + } +} + int main (int argc, char **argv) { @@ -562,6 +573,8 @@ main (int argc, char **argv) GdkPixmap *drag_icon; GdkPixmap *drag_mask; + test_init (); + gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); -- 2.30.2